extends ../layout

block content
  .container
    .row
      .panel.panel-default
        .panel-heading.text-center
          h3=keyword
        .panelbody
          if movies && movies.length > 0
            each item in movies
              .col-md-2
                .thumbnail
                  a(href="/movie/" + item._id)
                    img(src=item.poster, alt=item.title)
                .caption
                  h3= item.title
                  p: a.btn.btn-primary(href="/movie/"+item._id, role="button")
                    |观看预告片
    - var i = 0
    ul.pagination
      while i < totalPage
        if currentPage == ++i
          li.active
            span=currentPage
        else
          li
            if categoryId
              a(href='/results?category='+categoryId+'&page='+i)
                span=i
            else if search
              a(href='/results?search='+searchName+'&page='+i)


